<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- import common templates -->
<xsl:import href="../xml/templates/common.xsl"/>
<!-- import main_app templates -->
<xsl:import href="../xml/templates/nav_app.xsl"/>
<!-- xsl output -->
<xsl:output method='html' encoding='UTF-8' doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent='yes'/>

	<!-- Session ID -->
	<xsl:variable name="sid" select="root/input/id"/>

	<!-- template to generate main content -->
	<xsl:template name="BrowseContent">
		<!-- load extra tabindex params 
		<xsl:call-template name="ExtraDataLoader">
			<xsl:with-param name="src" select="extradata/tabindex"/>
		</xsl:call-template> -->
		<!-- main tab page -->
		 <div id="feed_wrapper">
			<h1>Your Feeds</h1>
			<a href="../help/walkthrough.html#arg_feeds" id="feed_wrapper_help" class="help_ico"  rel="This column is the list of all the feeds you previously subscribed. Click on one of them to have, here on the right, the list of all its items" onclick="return false;"><img src="../images/icons/help.png" class="help_ico" alt="help" /></a>
			<!-- FEED TOOLS SECTION -->
			<ul class="order_tools">
				<li><span id="feeds_filter_tool" class="filter" title="Filter">Filter</span></li>
				<!-- <li><span class="order_alpha"  title="Alphabetical Order">alphabetical order</span></li> -->
			</ul>
			<div class="filter_box" id="feed_filter">
				<label for="feed_search">Filter feeds </label><br/>
				<form>
					<input id="feed_search" type="text" value="Search..." onfocus='this.value = ""'/>
					<input id="feeds_filter_submit" type="submit" value="Go!" onclick="return false;" />
				</form>
			</div>
			<!-- END FEED TOOLS SECTION -->
			<ul id="feed_list">
				<xsl:for-each select="$src_data/userfeed/group">
					<li><a class="group_title" href="#"><xsl:value-of select="@groupname"/></a>
						<xsl:if test="feed">
							<ul class="feed_group">
								<xsl:for-each select="feed">
									<li><a>
										<xsl:variable name="xlink"><xsl:value-of select="link"/></xsl:variable>
										<xsl:attribute name="href"><xsl:value-of select="concat('../cgi-bin/browse_acc.pl?id=',$sid,'&amp;url=',link)"/></xsl:attribute>
										<xsl:attribute name="onclick">loadFeedItems('<xsl:value-of select="$xlink"/>');</xsl:attribute>
										<xsl:value-of select="name"/>
									</a></li>
								</xsl:for-each>
							</ul>
						</xsl:if>
						<xsl:if test="not(feed)">
							<ul class="empty_group"><li><a>&lt;empty></a></li></ul>
						</xsl:if>
					</li>
				</xsl:for-each>
			</ul>
			<!-- ACCESSIBILITY HELP -->
			<div class="access_help">
 				 <a href="#tools" accesskey="n">Jump to main content</a> 
			</div>
		</div>
		<!-- END FEEDS WRAPPER -->
  
		<!-- FEED ITEMS WRAPPER -->
		<div id="feed_items_wrapper">
			<h1>Feed Items</h1>
			<a href="../help/walkthrough.html#arg_items" id="feed_items_help"  class="help_ico"  rel="In this column you have the list of all the items of the feed you selected on the left. Click one of them to see its content" onclick="return false;"><img src="../images/icons/help.png" alt="help" class="help_ico" /></a>
			<!-- FEED ITEMS TOOLS -->
				<ul class="order_tools">
				<li><span id="items_filter_tool" class="filter" title="Filter">Filter</span></li>
				</ul>
				<div class="filter_box" id="items_filter">
					<form>
					<label for="items_search">Filter items </label><br/>
					<input id="items_search" type="text" value="Search..." onfocus='this.value = ""'/>
					<input id="items_filter_submit" type="submit" value="Go!" onclick="return false"/>
				</form>
				</div>
			<!-- END FEED ITEMS TOOLS -->
			<p id="he">Select a feed first</p>
			<!-- ACCESSIBILITY HELP -->
			<div class="access_help" id="acc_help_items">
 				 <a href="#tools" accesskey="n">Jump to main content</a> 
			</div>
			<!-- END ACCESSIBILITY HELP -->
		</div>
		<!-- END FEED ITEMS WRAPPER -->
		  
		<!-- FEED ITEM CONTENT WRAPPER -->
		<div id="feed_content_wrapper">
			<h1>Feed Item Content</h1>
			<a href="../help/walkthrough.html#arg_itemContent" id="feed_content_help" class="help_ico"  rel="Here is the content of the item you previously selected. Maybe the content you see here is not the whole content of the article. To be sure, follow the link under the title to travel to the original post." onclick="return false;"><img src="../images/icons/help.png" class="help_ico" alt="help" /></a>

			<!-- Contenuto della descrizoine dell'item generato con javascript -->
			<p id="he_cont">Select a feed item to view the description here</p> 
			<!-- ACCESSIBILITY HELP -->
			<div class="access_help" id="acc_help_content">
 				 <a href="#tools" accesskey="n">Jump to main content</a> 
			</div> 
		</div>
		<!-- END FEED ITEM CONTENT WRAPPER -->
		
	</xsl:template>
	
	<!-- CREATE PAGE -->
	
	<!-- create page structure -->
	<xsl:template match="root">
		<html>
			<!-- head -->
			<head>
				<!-- load common code -->
				<xsl:call-template name="Loader">
					<xsl:with-param name="src" select="$src_head"/>
				</xsl:call-template>
				<!-- load extra head params -->
				<xsl:call-template name="ExtraDataLoader">
					<xsl:with-param name="src" select="extradata/head"/>
				</xsl:call-template>
				<!-- load ie fix -->
				<xsl:call-template name="IELoader">
					<xsl:with-param name="src" select="$src_head_ie/root/common"/>
				</xsl:call-template>
				<xsl:call-template name="IELoader">
					<xsl:with-param name="src" select="extradata/IEFix"/>
				</xsl:call-template>
				<!-- pagetitle -->
				<title><xsl:value-of select="pagetitle"/></title>
			</head>
			<body>
				<!-- body onload attribute -->
				<xsl:if test="extradata/body/onload/text() != ''">
					<xsl:attribute name="onLoad"><xsl:value-of select="extradata/body/onload"/></xsl:attribute>
				</xsl:if>
				<!-- header -->			
				<xsl:call-template name="Loader">
					<xsl:with-param name="src" select="$src_header"/>
				</xsl:call-template>
				<!-- profile -->
				<xsl:call-template name="ProfileLoader">
					<xsl:with-param name="sid" select="input/id"/>
					<xsl:with-param name="page" select="page"/>
				</xsl:call-template>				
				<div id="content_wrapper">
					<!-- navbar -->
					<div id="main_app_navigation">
						<xsl:call-template name="NavAppLoader">
							<xsl:with-param name="src" select="$src_navbar"/>
						</xsl:call-template>
					</div>
					<!-- noscript
					<xsl:call-template name="ExtraDataLoader">
						<xsl:with-param name="src" select="extradata/noscript"/>
					</xsl:call-template> -->		
					<!-- access -->
					<xsl:call-template name="ExtraDataLoader">
						<xsl:with-param name="src" select="extradata/access"/>
					</xsl:call-template>
					<!-- content -->
					<xsl:call-template name="BrowseContent">
						<!--<xsl:with-param name="src" select="$src_footer"/>-->
					</xsl:call-template>
				</div>
				<!-- footer -->
				<xsl:call-template name="Loader">
					<xsl:with-param name="src" select="$src_footer"/>
				</xsl:call-template>				
			</body>
		</html>
	</xsl:template>
	
</xsl:stylesheet>	
